#ifndef __QUEUE_H
#define	__QUEUE_H


#include <stdint.h>


typedef enum {
    QUEUE_OK = 0x00,
    QUEUE_BUFFER_OVERFLOW = -1,
    QUEUE_BUFFER_NULL = -2,
    QUEUE_MALLOC_FAILURE = -3
} queue_err;


typedef struct {
   uint8_t *buf;
   uint32_t message_size;
   uint32_t message_max;
   uint32_t push_index;
   uint32_t pop_index;
   uint32_t cnt;
} queue_t;










queue_err queue_Init(queue_t *queue, uint32_t message_size, uint32_t message_max);
queue_err queue_DeInit(queue_t *queue);
uint32_t queue_get_cnt(queue_t *queue);
queue_err queue_push(queue_t *queue,void *message);
queue_err queue_pop(queue_t *queue,void *message);

#endif
